*Input global vehicle assembly data: 


import excel "$root/Data/Original/Global-vehicle-assembly-plant-database-2020-edition.xlsx", sheet("Global vehicle assembly plants") cellrange(A2:M752) firstrow clear

sort Brand

gen id_gvapd = _n

order id_gvapd

replace Brand = "opel" if Brand == "Opel/Vauxhall"

replace Brand = strlower(Brand)
replace Modelsbuilt2019status = strlower(Modelsbuilt2019status)

rename Brand MAKName
rename Modelsbuilt2019status TYPName1

replace MAKName = "alfa-romeo" if MAKName == "alfa romeo"
replace MAKName = "land-rover" if MAKName == "land rover"
replace MAKName = "mercedes" if MAKName == "mercedes-benz"

split TYPName1, parse(,)

rename *Name1* **

drop TYP

forvalues i = 1/12 {
	replace TYP`i' = trim(TYP`i') 
}

reshape long TYP, i(id_gvapd MAKName) j(i)

drop i 
drop if TYP == ""

rename TYP TYPName1

sort MAKName TYPName1

save "$root/Data/Original/GVAPD_2020.dta", replace

*Also generate a dataset tha measures the distance between Switzerland and all other countries based on gravity database: 

